package com.itheima.order.controller;

import com.itheima.goods.pojo.Order;
import com.itheima.order.service.OrderService;
import entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @author wang
 * @description
 * @date 2021/7/31 15:18
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    OrderService orderService;

    @GetMapping("/submitInfo/{goodId}")
    public Result getSubmitInfo(@PathVariable Integer goodId){
        return orderService.getSubmitInfo(goodId);
    }

    @PostMapping("/submitOrder")
    public Result submitOrder(@RequestBody Order order){
        return orderService.submitOrder(order);
    }
}
